package com.uwaterloo.jobmineplus.data;

public final class Location {
	private String building;
	private String room;
	
	public Location(String building, String room) {
		this.building = building;
		this.room = room;
	}

	public String getBuilding() {
		return building;
	}

	public String getRoom() {
		return room;
	}

	@Override
	public String toString() {
		return building + " " + room;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((building == null) ? 0 : building.hashCode());
		result = prime * result + ((room == null) ? 0 : room.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Location other = (Location) obj;
		if (building == null) {
			if (other.building != null)
				return false;
		} else if (!building.equals(other.building))
			return false;
		if (room == null) {
			if (other.room != null)
				return false;
		} else if (!room.equals(other.room))
			return false;
		return true;
	}
}
